# homework3.S - Translate the lower case letters into upper case in the string iostring
.section .data
iostring:
	.asciz "ab1g2hA0H56po9wK78nB"
.section .text
.globl _start
_start:
# Transform
	movl $iostring, %ebx
	movl $0, %edi
for:
	cmpl $20, %edi
	jb forcode
	jmp endfor
forcode:
if:
	movb (%ebx, %edi, 1), %al
	cmpb $0x61, %al
	jb endif
	cmpb $0x7A, %al
	ja endif
then:
	subb $0x20, %al
	movb %al, (%ebx, %edi, 1)
endif:
	incl %edi
	jmp for
endfor:

# output
	movl $4, %eax
	movl $1, %ebx
	movl $iostring, %ecx
	movl $20, %edx
	int $0x80

# exit
	movl $1, %eax
	movl $0, %ebx
	int $0x80
